Image processing apparatus and method

ABSTRACT

Disclosed are an image processing apparatus and method for the purpose of preventing overlapping of dots between two colors in low-density areas in color pseudo-grayscale processing, thereby obtaining excellent placement of the dots of each color. When a color image is binarized, an error is added to a respective one of color components (I 0 ,I 1 ), after which output decision means ( 2 ) decides an output value in accordance with the value of the sum in such a manner that the sum of pixel values after conversion will be rendered constant. Error calculation means ( 3 - 0, 3 - 1 ) calculate differences between pixel values before and after binarization as errors, and error diffusion means ( 9 - 0, 9 - 1 ) calculate values to be diffused to a neighboring pixel. Weighting coefficients used at such time are decided in accordance with combinations of values of the color components (I 0 ,I 1 ) of pixel values in the original image. The output value decided by the output decision means ( 2 ) is printed out by a printer or the like.

FIELD OF THE INVENTION

[0001] This invention relates to image processing in a printing apparatus. More particularly, the invention relates to image processing and a method thereof in an apparatus such as an ink-jet printing apparatus that expresses tones by pseudo-grayscale processing.

BACKGROUND OF THE INVENTION

[0002] The error diffusion method is known as an example of pseudo-halftone processing for expressing multivalued data by a binary value (see “An Adaptive Algorithm for Spatial Gray Scale”, Proceedings of the Society for Information Display, 1975, Symposium Digest of Technical Papers, 1975, 36). The error diffusion method, where P represents a pixel of interest, v the density of this pixel, v0, v1, v2 and v3 the densities of pixels P0, P1, P2 and P3, respectively, neighboring the pixel of interest P, and T a threshold value for binarizing these densities, is a method of diffusing binarization error E at the pixel of interest P to the neighboring pixels P0, P1, P2, P3 by weighting coefficients determined empirically, thereby making mean density equal to the density of the original image macroscopically.

[0003] According to the error diffusion method, we can write the following with regard to output binary data Do:

if v≧T holds, then Do=1, E=v−Vmax;  (1)

if v<T holds, then Do=0, E=v−Vmin;

[0004] (where Vmax and Vmin represent maximum and minimum density, respectively);

v 0=v 0+E×W0;  (2)

v 1=v 1+E×W1;  (3)

v 2=v 2+E×W2;  (4)

v 3=v 3+E×W3;  (5)

[0005] (example of weighting coefficients: W0={fraction (7/16)}, W1={fraction (1/16)}, W2={fraction (5/16)}, W3={fraction (3/16)}).

[0006] Ordinarily, processing is executed while the pixel of interest is shifted in sequence with the raster scan, and often the neighboring pixels P0, P1, P2, P3 chosen are the pixel adjacent the pixel of interest with respect to the scanning direction, the pixel immediately preceding the pixel directly below the pixel of interest, the pixel directly below the pixel of interest and the pixel immediately following the pixel directly below the pixel of interest. Conversely, the pixel of interest receives diffused error from the immediately preceding pixel, the pixel directly above and the two pixels on both sides of the pixel directly above the pixel of interest. Further, there are cases where a pixel neighboring a pixel of interest is non-existent, such as when the pixel of interest is at the beginning or end of a line, or when a line is the first line or last line. As a consequence, a method often adopted in such case is to adopt zero as the weight applied to a non-existent pixel and distribute the binarization error to the other pixels.

[0007] Furthermore, if an image to be processed is one of uniform density, there are instances where a visually disagreeable arrangement of printed dots occurs (namely deterioration of visual characteristics). In order to prevent this, the specification of Japanese Patent Application Laid-Open No. 3-88570 discloses a pseudo-halftoning method of selecting optimum weighting coefficients W0, W1, W2, W3 in accordance with density v of the pixel of interest. This method is such that pseudo-halftoning is capable of preventing the visually disagreeable arrangement of printed dots (the deterioration of visual characteristics), which is ascribable to changes in the spatial frequency of the image.

[0008] However, a problem arises when pseudo-halftoning is applied to a color image composed of multiple colors, such as the four colors of cyan, magenta, yellow and black employed in color ink-jet printers or the like. Specifically, since each color is processed individually using a method such as the error diffusion method, excellent visual characteristics are obtained when the image of each color is observed but this is not necessarily the case with regard to superimposed images of two or more colors.

[0009] In an effort to improve upon this drawback, the specifications of Japanese Patent Application Laid-Open Nos. 8-279920 and 11-10918 disclose a pseudo-halftoning method of obtaining excellent visual characteristics even with regard to superimposed images of two or more colors by combining two or more colors and then applying the error diffusion method.

[0010] This error diffusion method applied upon combining two or more colors makes it easy to optimize spatial frequency with regard to the entirety of an image of two or more colors to which error diffusion processing has been applied. However, optimizing the spatial frequency of images on a per-color-component basis is difficult. For example, assume that a color image of two colors has been subjected to this improved error diffusion processing. In this case, the dots will be disposed at a uniform spacing if the two images that have undergone error diffusion processing are observed together. If the image of each color is observed individually, however, dots become connected and unsightly dot placement is the result.

SUMMARY OF THE INVENTION

[0011] Accordingly, an object of the present invention is to provide an image processing apparatus and method in which when the error diffusion method is applied to image data of two or more color components upon combining the images of these two or more colors, a visually optimum placement of printed dots can be achieved (i.e., image data having the optimum spatial frequency can be generated) even in a case where images of all color components are observed simultaneously and even in a case where images of the single color components are observed individually.

[0012] According to the present invention, the foregoing object is attained by providing an image processing apparatus for processing multivalued color image data that includes a plurality of color components, comprising: adding means for adding per-color-component quantization error values from a neighboring pixel to a respective ones of a plurality of color components included in a pixel of interest; quantization means for correlating a sum of the values of each of the color components to which the error value has been added by the adding means to a sum of values after conversion, and deciding the value of each color component after conversion upon distributing the sum of pixel values after the conversion in accordance with the ratio of each of the color components before conversion; and coefficient decision means for deciding diffusion coefficients, which diffuse quantization error to neighboring pixels, based upon the value of each of the plurality of color components included in the pixel of interest.

[0013] Preferably, if the color components are approximately equal to one another, the coefficient decision means decides the diffusion coefficients in such a manner that the same diffusion coefficients are used for each of the color components.

[0014] Preferably, if the value of each of the color components before quantization is greater than the value of each of the color components after quantization in regard to the pixel of interest, the coefficient decision means decides the diffusion coefficients in such a manner that the smaller the difference between these values, the greater the diffusion ratio of the error value diffused to a pixel that follows the pixel of interest.

[0015] Preferably, the coefficient decision means decides the diffusion coefficients in such a manner that the smaller the value of a certain color component before quantization in regard to the pixel of interest, the diffusion coefficients of the other color components are decided so as to increase the diffusion ratio of the error value diffused to the pixel that follows the pixel of interest.

[0016] Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.

BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

[0018]FIG. 1 is a block diagram illustrating the structure of an image processing apparatus according to a first embodiment of the present invention;

[0019]FIG. 2 is a block diagram illustrating the construction of output decision means according to the first embodiment;

[0020]FIGS. 3A and 3B are schematic views illustrating the content of a LUT in the output decision means of the first embodiment;

[0021]FIG. 4 is a block diagram illustrating the structure of error calculation means according to the first embodiment;

[0022]FIG. 5 is a schematic view illustrating the content of a LUT in the error calculation means of the first embodiment;

[0023]FIGS. 6A and 6B are schematic views illustrating the content of a LUT in output decision means according to a second embodiment of the present invention;

[0024]FIG. 7 is a schematic view illustrating the content of a LUT in the error calculation means of the second embodiment;

[0025]FIGS. 8A and 8B are schematic views illustrating the content of a LUT in output decision means according to another embodiment of the present invention;

[0026]FIG. 9A is a diagram illustrating the content of a LUT (O₀) according to another embodiment;

[0027]FIG. 9B is a diagram illustrating the content of a LUT (O₁) according to another embodiment;

[0028]FIG. 10 is a schematic view illustrating the content of a LUT in the output decision means of the first embodiment;

[0029]FIG. 11 is a schematic view illustrating the content of a LUT in the output decision means of the second embodiment;

[0030]FIG. 12 is a block diagram illustrating the structure of weighting coefficient decision means according to the first embodiment;

[0031]FIG. 13 is a table illustrating the content of a LUT in the weighting coefficient decision means of the first embodiment;

[0032]FIG. 14A is a diagram illustrating the content of a LUT (S₀) in the weighting coefficient decision means of the first embodiment;

[0033]FIG. 14B is a diagram illustrating the content of a LUT (S₁) in the weighting coefficient decision means of the first embodiment;

[0034]FIG. 15A is a schematic view illustrating error diffusion (from left to right);

[0035]FIG. 15B is a schematic view illustrating error diffusion (from right to left);

[0036]FIG. 16 is a block diagram illustrating structure of the error diffusion means of the first embodiment;

[0037]FIG. 17A is a diagram illustrating an example of result of evaluation regarding weighting coefficients of the first embodiment;

[0038]FIG. 17B is a diagram illustrating an example of result of evaluation regarding weighting coefficients of the first embodiment;

[0039]FIG. 18 is a table illustrating the content of a LUT in the weighting coefficient decision means of the second embodiment;

[0040]FIG. 19A is a diagram illustrating the principle according to which the occurrence of a periodic pattern is prevented in output decision means according to the first embodiment; and

[0041]Fig. 19B is a diagram illustrating the principle according to which the occurrence of a periodic pattern is prevented in output decision means according to the prior art.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0042] (First Embodiment)

[0043] A first embodiment of the present invention will now be described in detail with reference to the drawings.

[0044]FIG. 1 is a block diagram illustrating the structure of an image processing apparatus according to a first embodiment of the present invention. The apparatus of FIG. 1 receives an input of 8-bit multivalued image data and outputs binary data by executing image processing.

[0045] As shown in FIG. 1, items of input-image pixel data I₀, I₁ of colors 0 (e.g., cyan) and 1 (e.g., magenta), which are items of 8-bit multivalued image data, are input to adders 1-0 and 1-1, respectively.

[0046] The multivalued image data I₀, I₁, error data EB′₀, EB′₁ from a line where pseudo-grayscale processing has previously been executed and error data EA′₀, EA′₁ from a neighboring (immediately preceding) pixel are input to the adders 1-0, 1-1, respectively, whereby these inputs are added and the sums delivered as outputs I′₀,I′₁, respectively.

[0047] Error buffers 10-0, 10-1 store the latest one line of error data that has already undergone pseudo-grayscale processing and output the error data EB′₀, EB′₁, which is added to a pixel of interest.

[0048] The outputs I′₀, I′₁ of the adders 1-0, 1-1, respectively, are input to output decision unit 2. The output decision unit 2 is constituted by LUTs, as shown in FIG. 2, and executes the following processing: First, when the signals I′₀,I′₁ are input to the output decision unit 2 from the adders 1-0, 1-1, respectively, reference is had to one-dimensional LUTs 7-0, 7-1 in FIG. 2, from which two signals g₀, g₁ are respectively output.

[0049]FIG. 10 is a diagram illustrating the content of the one-dimensional LUTs 7-0, 7-1. FIG. 10 shows the values of the signals g₀, g₁ output in accordance with the values of the inputs I′₀, I₁. The LUTs 7-0, 7-1 have identical content. The values of the signals g₀, g₁, which are input to an N-dimensional (N=2 in this embodiment because the input image data is 2-color data) LUT 4, represent lattice points to which the input values I′₀,I′₁, respectively, are nearest along the axial directions. In other words, the values of the signals g₀, g₁ are values obtained by quantizing the input values by the values corresponding to the lattice points.

[0050]FIGS. 3A and 3B illustrate the structure of the LUT 4. The horizontal axis in FIG. 3A represents the output g₀ from the LUT 7-0, and the vertical axis in FIG. 3A represents the output g₁ from the LUT 7-1. The four types of circular symbols in FIG. 3A indicate the values of outputs at the lattice points of the LUT 4, as indicated in FIG. 3B. If we let the output value of color 0 be O₀ and the output value of color 1 be O₁,then the four types of circular symbols indicate that outputs (O₀,O₁) at the lattice points are respective ones of the four types (0,0), (1,0), (0,1), (1,1). For example, if (g₀,g₁)=(6,7), then it will be understood from FIG. 3A that the symbol at this time is a black circle. If this value is read in FIG. 3B, therefore, it will be understood that the output (O₀,O₁) is (1,1) . The actual LUT 4 is constructed in the form of a table in which a set of (g₀,g₁) and a set of (O₀,O₁) are correlated in accordance with FIGS. 3A, 3B.

[0051] For example, if (I′₀,I′₁)=(383,256) holds, then (g₀,g_(l))=(8,6) is output from the LUT of FIG. 10. If reference is had to FIGS. 3A, 3B based upon these values, i.e., if the LUT 4 is looked up, it will be understood that (O₀,O₁)=(1,1) . Thus, if the signals g₀ and g₁ are output, one lattice point in the N-dimensional LUT 4 is decided and the output values at this lattice point are delivered as outputs O₀, O₁ of the output decision unit 2.

[0052]FIGS. 3A, 3B and FIG. 10 can be constructed as a single table, i.e., the LUTs 7-0, 7-1, 4 can be unified. In such case, I′₀, I′₁ would be plotted along the horizontal and vertical axes, respectively, instead of g₀, g₁ in FIG. 3A, and (O₀,O₁) would be disposed at the intersections of these values so as to achieve correspondence with FIG. 3A.

[0053] Furthermore, the outputs O₀, O₁ of the output decision unit 2 are input to error calculation unit 3-0, 3-1, respectively. The error calculation unit 3-0, 3-1 are constructed as shown in FIG. 4. The outputs O₀, O₁ of the output decision unit 2 and the outputs I′₀, I′₁ of the adders 1-0, 1-1 are input to the error calculation unit 3-0, 3-1, respectively, which proceed to output the errors E₀, E₁, respectively. When the outputs O₀, O₁ of the output decision unit 2 enter a one-dimensional LUT 5, as shown in FIG. 4, the LUT 5 is looked up and O′₀, O′₁ are output. As shown in FIG. 5, the outputs O′₀, O′₁ of the LUT 5 are values obtained by converting the outputs O₀, O₁ (values of 0 or 1 in this embodiment) of the output decision unit 2 to input signal levels (0 to 255; 0 or 255 in FIG. 5).

[0054] The outputs O′₀, O′₁ are subtracted respectively from the outputs I′₀, I′₁ of the adders 1-0, 1-1 by a subtractor 6, whereby the error outputs E₀, E₁ are obtained. In other words, we have the following:

E ₀ =I′ ₀ −O′ ₀

E ₁ =I′ ₁ −O′ ₁

[0055] The error E₀ and a set of weighting coefficients W0₀, W1₀, W2₀, W3₀ indicative of error diffusion to neighboring pixels are input to error diffusion unit 9-0, and the error E₁ and a set of weighting coefficients W0₁, W1₁, W2₁, W3₁ indicative of error diffusion to neighboring pixels are input to error diffusion unit 9-1. The error diffusion unit 9-0 outputs error data EA₀ directed to an adjacent pixel and error data EB₀ directed to the next line, and the error diffusion unit 9-1 outputs error data EA₁ directed to the adjacent pixel and error data EB₁ directed to the next line.

[0056]FIG. 16 illustrates the structure of the error diffusion unit 9-0. The error diffusion unit 9-0 has multipliers 11, 12, 13, 14 for multiplying the error E₀ by the weighting coefficients W0₀, W1₀, W2₀, W3₀, respectively, thereby outputting errors e0 ₀, e1 ₀, e2 ₀, e3 ₀ to be distributed. This is equivalent to the following operations:

e 0 ₀ =E ₀×W0₀

e 1 ₀ =E ₀×W1₀

e 2 ₀ =E ₀×W2₀

e 3 ₀ =E ₀×W3₀

[0057] Next, the error e0 ₀ is output as EA₀ after being delayed by one pixel by a latch 15. The error e1 ₀ is added to the error e2 ₀ by an adder 17 after being delayed by one pixel by a latch 16. Furthermore, the output of the adder 17 is added to the error e3 ₀ by an adder 19 after being delayed by one pixel by a latch 18. The sum calculated by the adder 19 is delivered as an output.

[0058] The above processing is equivalent to the following equations, where the coordinates of the pixel of interest are (x,y) and the errors at the pixel of interest are represented by e0 ₀(x,y), e1 ₀(x,y), e2 ₀(x,y), e3 ₀(x,y):

EA ₀ =e 0 ₀(x−1,y)

EB ₀ =e 1 ₀(x,y)+e 2 ₀(x−1,y)+e 3 ₀(x−2,y)

[0059] Similarly, the error diffusion unit 9-1 executes processing that is equivalent to the following operations:

e 0 ₁ =E ₁×W0₁

e 1 ₁ =E ₁×W1₁

e 2 ₁ =E ₁×W2₁

e 3 ₁ =E ₁×W3₁

EA ₁ =e 0 ₁(x−1,y)

EB ₁ =e 1 ₁(x,y)+e 2 ₁(x−1,y)+e 3 ₁(x−2,y)

[0060] By virtue of the above arrangement, binarization error of a pixel of interest is distributed to neighboring pixels in accordance with predetermined weighting, and a pseudo-grayscale image can be produced while the density of the original multivalued image is maintained overall. Furthermore, in the binarization processing, the image quality (visual characteristics) of the pseudo-grayscale image can be improved by using the LUT 4 of FIG. 2, FIGS. 3A, 3B and FIG. 10.

[0061] By way of example, in case of a set of two colors, namely color 0 and color 1, consider an image in which pixels of fixed values are uniformly distributed for both of these colors. Since the error between a binarization threshold value and value of the pixel of interest is diffused to neighboring pixels in accordance with weighting by pseudo-grayscale processing based upon the above-described error diffusion method in the aforesaid image, a pattern 0→1 or 1→0 occurs regularly in accordance with the pixel values and specific parameters in the image after binarization. As a result, with regard to an area having a certain area (number of pixels), mean density comparable with that the original image is maintained also in the binary image that has undergone pseudo-grayscale processing. However, the 0→1 or 1→0 pattern that is produced in this binary image becomes texture composed of a periodic pattern that does not originally exist in the image, thereby degrading image quality and resulting in the generation of a visually disagreeable image.

[0062] Furthermore, if binarization processing based upon the error diffusion method is executed independently for each color component of a color image, as in the prior-art example, texture is produced independently color by color. In a case where color images are observed in combined form, the texture per color component is emphasized as an interference pattern and image quality declines markedly, i.e., a visually disagreeable image is produced.

[0063] By contrast, according to this embodiment, the LUT illustrated in FIGS. 3A, 3B (and FIG. 10) is used is determining a binarization threshold value and, hence, the set (O₀,O₁) of output values is given with regard to the set (I′₀,I′₁) of pixel values following error-diffusion processing. Even if the image is one in which pixels of fixed values are evenly distributed with regard to each of the color components, binarization of one of the color components is carried out, taking into consideration the pixel value of the other color component prevailing after error diffusion, by executing binarization processing using the LUT of FIGS. 3A, 3B. Even in the above case, therefore, the pixel values of the plurality of color components will not change in the form of respectively independent patterns.

[0064]FIGS. 19A and 19B illustrate an example of this. FIG. 19A is a schematic view showing an example of binarization processing of a uniform image using a conversion LUT for converting (I′₀,I′₁) to (O₀,O₁) in this embodiment, and FIG. 19B is a schematic view showing an example of binarization processing of a uniform image using a conversion LUT for converting (I′₀,I′₁) to (O₀,O₁) in an example of the prior art. In FIGS. 19A, 19B, the horizontal and vertical axes indicate I′₀ and I′₁, respectively, and each of the divided areas indicates 0 ₀, 0 ₁. The values of 0 ₀, 0 ₁ are as indicated at a corner of each area, and the oriented lines indicate examples of contiguous pixels to be processed successively.

[0065] If a pixel value 1951 of an original image to be targeted initially is given in FIG. 19B, first a conversion is made to (O₀,O₁)=(0,0), error accumulates in the pixel value of the pixel that follows this pixel, and the conversion to (O₀,O₁)=(0,0) continues until a fixed threshold value is attained. First, a threshold value 1952 for conversion to 1 in reached in regard to I′₀, and the conversion to (O₀,O₁)=(1,0) is made. The sign of the error is reversed with regard to I′₀, and the error is accumulated. With regard to I′₁, however, the conversion to 0 continues to be made and an error value similar to that thus far continues to accumulate. As a result, (I′₀,I′₁) returns to a pixel value 1953. This operation continues in the following manner: pixel value 1954→1955→1956→1957. When pixel value 1958 is reached, now the value of I′₁ exceeds the threshold value for the conversion to 1. As a result, the sign of the error value is reversed and a pixel value 1959 is returned to in a manner similar to that of I′₀.

[0066] By repeating traversal of the above path, the conversion from (I′₀,I′₁) to (O₀,O₁) is carried out. In FIG. 19B, the change in the value of O₀ is the interval of pixel value 1953→1954, pixel value 1955→1956, and pixel value 1957→1958→1960. Further, since one oriented line indicates accumulation of amount of error that accumulates whenever the pixel of interest advances to the adjacent pixel, a fixed periodicity is observed by accumulating error a fixed value at a time. The same holds true with regard to O₀. Thus, the change to 0→1 or 1→ is repeated at respectively independent spatial periodicity while performing the conversion from I′₀ to O₀ and the conversion from I′₁ to O₁ entirely independently.

[0067] By contrast, if a pixel value 1901 of an original image to be targeted initially is given in FIG. 19A, then, in a manner similar to that of FIG. 19B, first a conversion is made to (O₀,O₁)=(0,0), error accumulates in the pixel value of the pixel that follows this pixel, and the conversion to (O₀,O₁)=(0,0) continues until a fixed threshold value is attained. First, a threshold value 1902 for conversion to 1 in reached in regard to I′₀, and the conversion to (O₀,O₁)=(1,0) is made. The sign of the error is reversed with regard to I′₀, and the error is accumulated. With regard to I′₁, however, the conversion to 0 continues to be made and an error value similar to that thus far continues to accumulate. As a result, (I′₀,I′₁) returns to a pixel value 1903. This operation continues in the following manner: pixel value 1904→1905→1906→1907. When pixel value 1908 is reached, now the value of I′₁ exceeds the threshold value for the conversion to 1. As a result, the sign of the error value is reversed and a pixel value 1909 is returned to in a manner similar to that of I′₀.

[0068] Though it may seem up to this point that periodicity is present also in FIG. 19A, error must accumulate until the pixel value arrives at 1910 from 1909 in order for the value of O₀ to change to 1 next. This produces a major disturbance in periodicity up to this point. The same is true with regard to O₁.

[0069] Thus, according to the procedure of this embodiment, changes in the values of binarized pixels of a plurality of color components have an influence upon each other, and this has the effect of breaking the monotonous periodicity produced with regard to the change in pixel values.

[0070] The above operation is such that the pseudo-grayscale processing of this embodiment is ascertained dynamically taking processing concerning a uniform image as an example. However, in a case where a specific pixel is taken as the pixel of interest, this processing can be ascertained statically. Specifically, in the pseudo-grayscale processing described above, the value of the sum of a plurality of pixel values following error diffusion regarding an original image is correlated with a value of the sum of a plurality of pixel values after binarization. How the value of the sum is distributed to each of the components is dependent upon the ratio of the components of the original pixel value. This should be evident from the fact that the sum of the pixel values of the two colors after conversion is constant along the direction of the diagonal from the upper left to the lower right of the conversion table shown in FIG. 3A. That is, a similar conversion can be carried out by comparing the sum of the values of each of the color components prior to conversion with a constant threshold value, first deciding the sum of the values after conversion in accordance with the result of the comparison, and then, with regard to the sum of the pixel values after the conversion, deciding the pixel values in such a manner that values are diffused to each of the color components after conversion in accordance with the ratio of the color components before the conversion.

[0071] As a result, the sum of the pixel values at the same position of each of the color components in the original image is reflected in the visual density in a case where these color components are observed together. This makes it possible to prevent a decline in image quality and deterioration of visual characteristics.

[0072] <Deciding Weighting Coefficients>

[0073] A characterizing feature of the present invention, namely weighting coefficient decision unit 8 for deciding the weighting coefficients W0₀, W1₀, W2₀, W3₀ and W0₁, W1, W2₁, W3₁, will now be described. According to this embodiment, besides adopting the above-described binarization LUT, inventive processing is executed in the decision of error-diffusion weighting coefficients.

[0074] As illustrated in FIG. 15A, error is distributed to a pixel alongside a pixel of interest “*”, the pixel underlying this pixel of interest, a pixel diagonally below this pixel of interest and pixel along this latter pixel by the error diffusion unit 9-0, 9-1. Further, according to this embodiment, the direction in which pixels are processed is switched line by line. Consequently, the processing direction is as shown in FIG. 15B in a case where the direction is opposite that in FIG. 15A.

[0075] As shown in FIG. 12, weighting coefficient decision unit 8 receives the signals I₀, I₁ as input values and outputs signals S₀, S₁ from a LUT 20. As illustrated in FIG. 13, the LUT 20 is composed of a table that outputs S₀, S₁ based upon the two inputs I₀, I₁. The signals S₀, S₁ are input to LUTs 21, 22, respectively, the LUT 21 outputs the weighting coefficients W0₀, W1₀, W2₀, W3₀ and the LUT 22 outputs the weighting coefficients W0₁, W1₁, W2₁, W3₁. In this embodiment, the neighboring pixel to which error is distributed is the same and therefore the content of LUT 21 is the same as that of LUT 22, as shown in FIGS. 14A and 14B. In other words, in this embodiment it does not matter if the same LUT is employed.

[0076] Processing of one item of input data is executed by the above arrangement. Accordingly, one line of processing is executed by repeating the above processing while effecting a shift one pixel at a time in the processing direction, and pseudo-grayscale processing of the entire image is possible by repeating similar processing while effecting a shift one raster at a time.

[0077] The significance of the structure of LUT 20 as shown in FIG. 13 will be described next. FIGS. 17A and 17B illustrate results of investigating image quality, namely visual excellence, in a case where pseudo-grayscale processing has been applied to a uniform color image in which color is given by several exemplary combinations of I₀ and I₁ while selecting S₀, S₁ within the weighting coefficient decision unit 8.

[0078]FIGS. 17A, 17B are tables in which values of sets of I₀, I₁ are adopted as the columns and combinations of S₀, S₁ used are adopted as the rows. With regard to the values of S₀, S₁, these correspond to the weighting coefficients depicted in FIGS. 14A, 14B. For instance, take an image in which 0, 1 holds for the two components I₀, I₁, respectively, as an example. If values 0, 0 are used as S₀, S₁, respectively, then the evaluation in this case will be “DISAGREEABLE”, meaning that a low evaluation is given. On the other hand, if values 1, 1 are used as S₀, S₁, respectively, then the evaluation in this case is “EXCELLENT”, meaning that the evaluation is high. FIGS. 17A, 17B are obtained as the result of trying binarization processing while changing weighting coefficients with regard to several representative values.

[0079] Results obtained by investigating an image in which the value of I₁ is held constant and only the value of I₀ is changed are shown in FIG. 17A. In FIGS. 17A, 17B, it will be understood that although the weighting coefficient S₁=1 for which the “EXCELLENT” evaluation has been obtained exists with regard to all values of I₀, excellent dot placement will not be obtained if the inputs I₀, I₁ are handled independently at other values. In other words, the selection of optimum weighting coefficients must be made in accordance with the combination of I₀ and I₁.

[0080]FIG. 13 shows a table in which weighting coefficients for which the high evaluation has been obtained are correlated with I₀, I₁. In FIG. 13, in which areas are demarcated by the bold lines, the weighting coefficients change from one area to the next. This selection method provides a weighting coefficient table in which the high evaluation is obtained even in the tables shown in FIGS. 17A, 17B. Densities not shown in FIGS. 17A, 17B also are evaluated empirically in a manner similar to that of FIGS. 17A, 17B and the table of FIG. 13 is constructed in accordance with the results.

[0081] The characterizing feature of FIG. 13 is that in a case where I₀, I₁ take on substantially the same values (the diagonal from the upper left to the lower right of FIG. 13), the weighting coefficient table used also is the same with regard to I₀, I₁, and in a case where I₀ and I₁ differ from each other, the weighting coefficient table also is implemented with a different distribution. Furthermore, weighting coefficient tables for which the values of I₀, I₁ are rendered symmetrical are selected. In other words, if the values of I₀, I₁ have been interchanged, the weighting coefficient tables used with regard to each of the colors also are interchanged.

[0082] Furthermore, only in a case where the pixel values are 2 and 15 with regard to each color in FIG. 13 is the weighting coefficient table used for the sake of this color component changed in accordance with the value of the other color component. At values other than these, the weighting coefficient table is selected only in accordance with one of the pixel values.

[0083] Furthermore, as the pixel value increases, the proportion of the error value distributed to the pixel that follows the pixel of interest is reduced and the proportion of the error value distributed to the next line is enlarged. If the size of the pixel value becomes 16 or greater, the weighting coefficient table used with regard to this color is fixed at S₀ and is changed within a small range of 0 to 15.

[0084] If this is considered in application to FIG. 19A, the following may be construed: Specifically, the slope of the oriented lines in FIG. 19A indicates the ratio of error values distributed to each of the color components at the pixel of interest by a first cycle of binarization processing. Accordingly, the slope changes depending upon the ratio of the error value of each color. As a result, the slope of the oriented lines is changed by changing only one of the error values that accumulate with regard to each color component by the first cycle of binarization processing. The number of changeovers of the value regarding the color 0 produced until the output value changes over from (0,1) to (1,0) also changes. For example, if the slope is enlarged in the example of FIG. 19A, the number of repetitive patterns produced with regard to the color 0 during the time that the output value changes from (0,1) to (1,1) becomes small. If this number is small, periodicity does not readily manifest itself. Accordingly, the occurrence of texture in each color component can be suppressed by enlarging the slope. In FIG. 19A, pixel values from 1901 to 1908 correspond to the above-mentioned pattern repetition, and the repetition periodicity is disturbed by the return of the pixel value to 1909. If the slope of each oriented line is enlarged at this time, the area in which the output values become (0,1) should be reached with a smaller number oriented lines.

[0085] Changing over the weighting coefficient in the manner illustrated in FIG. 13 corresponds to changing the slope of the oriented lines in FIG. 19A, and the effect of enlarging the slope with regard to a pixel having a small value is incorporated in the table of FIG. 13. Execution of such control is limited to small pixel values because if a pixel value increases to a certain degree, pixel density in the binarized image also increases and texture itself becomes inconspicuous in a case where individual color elements are observed.

[0086] As a result of the above arrangement, the image processing apparatus according to the present invention converts a color image composed of a plurality of color elements to a pseudo-grayscale image in such a manner that a decline in image quality will not be brought about. This makes it possible to output an image of higher quality.

[0087] This embodiment has been described with regard to a case where two colors is adopted as one set. However, three or four colors can be adopted as a set, binarization processing applied to combinations of these values and error weightings converted in conformity with the pixel values. Though this arrangement becomes much more complicated, what is common with the present embodiment is that binarization processing is not executed independently with regard to each color component and combined binarized values are applied in accordance with the combined values. These values are obtained by correlating values of sums of each of the components before and after binarization and making the distribution of values of each of the color components after binarization conform to the distributions before binarization.

[0088] Furthermore, with regard also to the weighting coefficients of error diffusion, the optimum proportions are decided by the combinations of values of each of the color components in the original image, thereby making it possible to improve image quality. Though the method of deciding the proportions may be determined experimentally, the determination can also be made based upon the considerations cited above.

[0089] The binary image thus obtained is input to printer engine (not shown) of an ink-jet printer or the like and is printed and fixed as a permanent image.

[0090] [Second Embodiment]

[0091] In this embodiment, it is assumed that there are three gray levels, namely 0, 1 and 2, for each of the outputs O₀, O₁.

[0092] In this case, the structure of the processing apparatus itself is unchanged from that of the first embodiment shown in FIG. 1 but the contents of the LUTs 7-0, 7-1, LUT 4 and LUT 5 in the output decision unit 2 and error calculation unit 3-0, 3-1, which are components in the image processing apparatus, are different.

[0093]FIGS. 11, 6A, 6B and 7 illustrate the contents of the LUTs 7-0, 7-1, LUT 4 and LUT 5 in the second embodiment of the invention.

[0094]FIG. 11 illustrates the content of the LUTs 7-0, 7-1. FIG. 11 shows the values of the signals g₀, g₁, output in accordance with the values of the inputs I′₀ I′₁.

[0095] In the case of this embodiment, this content is adopted because the number of output gray levels is three with regard to each input and the number of lattice points seven for each input.

[0096]FIGS. 6A and 6B illustrate the structure of the LUT 4. The horizontal axis in FIG. 6A represents the output I′₀ from the adder 1-0, and the vertical axis in FIG. 6A represents the output I′₁ from the adder 1-1.

[0097] The nine types of symbols in FIGS. 6A, 6B indicate the values of outputs at the lattice points of the LUT. If we let the output value of color 0 be O₀ and the output value of color 1 be O₁, then the symbols indicate that outputs (O₀,O₁) at the lattice points are respective ones of the four types (0,0), (1,0), (0,1), (2,0), (1,1), (0,2), (2,1), (1,2), (2,2).

[0098] The processing by output decision unit 2 is as follows: In a manner similar to that where the number of gray levels is two, I′₀ and I′₁ enter from the adders 1-0, 1-1, the LUT shown in FIGS. 6A, 6B is looked up, lattice points closest to the input values are selected and the output values at the lattice points are delivered as outputs O₀, O₁ of the output decision unit 2.

[0099] The outputs O₀, O₁ of the output decision means 2 are input to the error calculation unit 3-0, 3-1, respectively.

[0100] The error calculation unit 3-0, 3-1 refer to the one-dimensional LUT of the kind shown in FIG. 7, find O′₀, O′₁ from O₀, O₁ and calculate the errors E₀, E₁ in a manner similar to that of the above-described example. In other words, the following calculations are performed:

E ₀ =I′ ₀ −O′ ₀

E ₁ =I′ ₁ −O′ ₁

[0101] The LUT 20 in the coefficient decision unit is set to the parameters shown in FIG. 18.

[0102] By processing similar to that in the case where the number of gray levels of the outputs O₀, O₁ is two each, it is possible to deal with a case where the number of gray levels of the outputs O₀, O₁ is three each.

[0103] This arrangement is such that even in a case where a multivalued color image is converted by the error diffusion method to an image having fewer gray levels than the original image, a plurality of color components at a pixel of interest are adopted as a set and a conversion is made so as to correlate the sum thereof to the sum of pixel values after conversion, whereby a high-quality image can be obtained.

[0104] In FIG. 6A, the sum of pixel values after conversion is 0 in an area 601, the sum of pixel values after conversion is 1 in areas 602 and 603, the sum of pixel values after conversion is 2 in areas 604 to 606, the sum of pixel values after conversion is 3 in areas 607 and 608, and the sum of pixel values after conversion is 4 in an area 609. Areas in which the same sums have the same values are disposed along the diagonal from the upper left to the lower right of FIG. 6A. This disposition is such that if the sum of g₀ and g₁ is constant, then the sum of the pixel values after conversion also will be constant.

[0105] It should be evident from FIG. 7 that error is calculated using 0, 128, 255, which are values after the ternary conversion, as the reference. As a result, the distribution of pixels after the ternary conversion becomes sporadic even in the vicinity of values where pixel values in the vicinity of the reference values slightly exceed the reference values because the error values generated become small. Texture is thus readily produced. In FIG. 18, therefore, the distribution of error is controlled very finely, in a manner similar to that of the table shown in FIG. 13, in the range of pixel values 128 to 136, and occurrence of texture is suppressed effectively.

[0106] [Other Embodiments]

[0107] In the output decision unit of the above embodiments, LUTs are used. However, as disclosed in the specifications of Japanese Patent Application Laid-Open Nos. 8-279920 and 11-10918, etc., similar results are obtained even if use is made of processing that decides the outputs O₀, O₁ sequentially by conditional branching conforming to the inputs I′₀, I′₁.

[0108] Further, the outputs produced by the weighting coefficient decision means are made S₀, S₁, and the error calculation by the error diffusion means can be speeded up by putting e0 ₀, e1 ₀, e2 ₀, e3 ₀ and e0 ₁, e1 ₁, e2 ₁, e3 ₁, which are the result of error diffusion corresponding to the entered S₀, S₁ and of division of E₀, E₁, into the form of a LUT.

[0109] Thus, the weighting coefficient decision unit is not limited to an arrangement that outputs the weighting coefficients themselves, and it will suffice if parameters that have been associated with weighting coefficients are output to each error diffusion unit.

[0110] Further, weighting coefficients may be decided using values obtained after the inputs I₀, I₁ in the weighting coefficient decision unit are passed through a low-pass filter such as one that calculates the running mean of a plurality of pixels.

[0111] Further, the present invention can be applied also to a case where a grayscale conversion has been performed by the error diffusion method using three values for one color component and two values for the other color component, as shown in FIGS. 8A, 8B and FIGS. 9A, 9B. The essentials in this case are similar to those of the first and second embodiments.

[0112] In accordance with the present invention, as described above, it is possible to achieve a visually optimum placement (spatial frequency) of printing dots, even in a case where the error diffusion method is used upon combining two or more colors, by providing adding means, to which a multivalued image signal of two or more colors is input, for adding, on a per-color basis, error signals from a pixel that has already undergone pseudo-grayscale processing to respective one of the colors; output decision means, to which outputs from each of the adding means are input, for deciding a pseudo-grayscale output for every color; error calculation means for each color for calculating an error at a pixel of interest based upon an output for every color from the output decision means and outputs from the adding means for every color; error diffusion means for distributing (diffusing) the error for every color to neighboring pixels; and weighting coefficient means, to which the multivalued image signal is input, for deciding, on a per-color basis, an error diffusion allocation in the error diffusion means.

[0113] Thus, in a case where two or more colors are combined and the error diffusion method is used, it is possible to achieve a visually optimum placement (spatial frequency) of printing dots.

[0114] In particular, the ratio at which error is diffused to neighboring pixels is decided depending upon a combination of values of a plurality of color components at a pixel of interest and is not decided independently for each individual color component, thereby suppressing the occurrence of periodic texture in the image of each color component. This makes it possible to suppress interference patterns caused by interference between textures.

[0115] As many apparently widely different embodiments of the present invention can be made without departing from the spirit and scope thereof, it is to be understood that the invention is not limited to the specific embodiments thereof except as defined in the appended claims. 

What is claimed is:
 1. An image processing apparatus for processing multivalued color image data that includes a plurality of color components, comprising: adding unit adapted to add per-color-component quantization error values from a neighboring pixel to a respective ones of a plurality of color components included in a pixel of interest; quantization unit adapted to correlate a sum of the values of each of the color components to which the error value has been added by the adding unit to a sum of values after conversion, and deciding the value of each color component after conversion upon distributing the sum of pixel values after the conversion in accordance with the ratio of each of the color components before conversion; and coefficient decision unit adapted to decide diffusion coefficients, which diffuse quantization error to neighboring pixels, based upon the value of each of the plurality of color components included in the pixel of interest.
 2. The apparatus according to claim 1, wherein if the color components are approximately equal to one another, said coefficient decision unit decides the diffusion coefficients in such a manner that the same diffusion coefficients are used for each of the color components.
 3. The apparatus according to claim 1, wherein if the value of each of the color components before quantization is greater than the value of each of the color components after quantization in regard to the pixel of interest, said coefficient decision unit decides the diffusion coefficients in such a manner that the smaller the difference between these values, the greater the diffusion ratio of the error value diffused to a pixel that follows the pixel of interest.
 4. The apparatus according to claim 1, wherein said coefficient decision unit decides the diffusion coefficients in such a manner that the smaller the value of a certain color component before quantization in regard to the pixel of interest, the diffusion coefficients of the other color components are decided so as to increase the diffusion ratio of the error value diffused to a pixel that follows the pixel of interest.
 5. A program for causing multivalued color image data that includes a plurality of color components to be processed by a computer, said program causing the computer to execute as the following steps of: adding per-color-component quantization error values from a neighboring pixel to a respective ones of a plurality of color components included in a pixel of interest; correlating a sum of the values of each of the color components to which the error value has been added by said adding step to a sum of values after conversion, and deciding the value of each color component after conversion upon distributing the sum of pixel values after the conversion in accordance with the ratio of each of the color components before conversion; and deciding diffusion coefficients, which diffuse quantization error to neighboring pixels, based upon the value of each of the plurality of color components included in the pixel of interest.
 6. The program according to claim 5, wherein if the color components are approximately equal to one another, said deciding step decides the diffusion coefficients in such a manner that the same diffusion coefficients are used for each of the color components.
 7. The program according to claim 5, wherein if the value of each of the color components before quantization is greater than the value of each of the color components after quantization in regard to the pixel of interest, said deciding step decides the diffusion coefficients in such a manner that the smaller the difference between these values, the greater the diffusion ratio of the error value diffused to a pixel that follows the pixel of interest.
 8. The program according to claim 5, wherein said deciding step decides the diffusion coefficients in such a manner that the smaller the value of a certain color component before quantization in regard to the pixel of interest, the diffusion coefficients of the other color components are decided so as to increase the diffusion ratio of the error value diffused to a pixel that follows the pixel of interest.
 9. An image processing method for processing multivalued color image data that includes a plurality of color components, comprising: an adding step of adding per-color-component quantization error values from a neighboring pixel to a respective ones of a plurality of color components included in a pixel of interest; a quantization step of correlating a sum of the values of each of the color components to which the error value has been added by the adding step to a sum of values after conversion, and deciding the value of each color component after conversion upon distributing the sum of pixel values after the conversion in accordance with the ratio of each of the color components before conversion; and a coefficient decision step of deciding diffusion coefficients, which diffuse quantization error to neighboring pixels, based upon the value of each of the plurality of color components included in the pixel of interest.
 10. The method according to claim 9, wherein if the color components are approximately equal to one another, said coefficient decision step decides the diffusion coefficients in such a manner that the same diffusion coefficients are used for each of the color components.
 11. The method according to claim 9, wherein if the value of each of the color components before quantization is greater than the value of each of the color components after quantization in regard to the pixel of interest, said coefficient decision step decides the diffusion coefficients in such a manner that the smaller the difference between these values, the greater the diffusion ratio of the error value diffused to a pixel that follows the pixel of interest.
 12. The method according to claim 9, wherein said coefficient decision step decides the diffusion coefficients in such a manner that the smaller the value of a certain color component before quantization in regard to the pixel of interest, the diffusion coefficients of the other color components are decided so as to increase the diffusion ratio of the error value diffused to a pixel that follows the pixel of interest.
 13. A computer-readable recording medium on which the program set forth in claim 5 has been recorded.
 14. An image processing apparatus comprising: adding unit, to which a multivalued image signal of two or more colors is input, for adding, on a per-color basis, error signals from a pixel that has already undergone pseudo-grayscale processing to respective one of the colors; output decision unit, to which outputs from each of said adding unit are input, for deciding a pseudo-grayscale output for every color; error calculation unit for each color for calculating an error at a pixel of interest based upon an output for every color from said output decision unit and outputs from said adding unit for every color; error diffusion unit for diffusing the error for every color to neighboring pixels; and weighted-error diffusion decision unit, to which the multivalued image signal of two or more colors is input, for deciding, on a per-color basis, an error diffusion allocation in said error diffusion unit.
 15. A color printer comprising: the image processing apparatus set forth in claim 1; and a printer engine for printing multivalued color image data that has been quantized by said image processing apparatus. 